//
//  YBNormalWaterCollectionViewCell.m
//  GongXinDangJian
//
//  Created by apple on 17/11/30.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "YBNormalWaterCollectionViewCell.h"


@implementation YBNormalWaterCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initMyCell];
    }
    return self;
}



-(void)initMyCell{
    [self.contentView addSubview:self.deleteButton];
    [self.contentView addSubview:self.cellTitleLabel];
}

-(void)setModel:(YBPeopleInfoModel *)model
{
    _model = model;
    if (self.isSelectVC) {
        self.cellTitleLabel.frame = CGRectMake(ItemWidth * 60, 0, model.selectNameWidth, ItemHeight * 75);
    }
    else{
        self.cellTitleLabel.frame = CGRectMake(ItemWidth * 60, 0, model.nameWidth, ItemHeight * 75);
    }
    self.cellTitleLabel.text = [NSString stringWithFormat:@"%@-%@" , [ToolClass returnNoNullStringWithString:model.F_DEPT_NAME] , [ToolClass returnNoNullStringWithString:model.NAME]];
}


-(UIButton *)deleteButton
{
    if (!_deleteButton) {
        _deleteButton = [ToolClass createButtonWithFrame:CGRectMake(0, 0 , ItemWidth * 60, ItemHeight * 75) text:@"" textColor:[UIColor whiteColor] imageName:@"del_people" font:16];
        _deleteButton.imageEdgeInsets = UIEdgeInsetsMake((ItemHeight * 75 - ItemWidth * 38) / 2, ItemWidth * 6, (ItemHeight * 75 - ItemWidth * 38) / 2, ItemWidth * 16);
    }
    return _deleteButton;
}

-(UILabel *)cellTitleLabel
{
    if (!_cellTitleLabel) {
        _cellTitleLabel = [ToolClass creatLabelWithFrame:CGRectMake(ItemWidth * 60, 0, 1, ItemHeight * 75) font:15 textColor:[UIColor blueColor] text:@""];
    }
    return _cellTitleLabel;
}


@end
